package config

import (
	"github.com/jmoiron/sqlx"
)

type Config struct {
	FastDBPort        uint16 `toml:"fastdb_port"`
	FastDBIp          string `toml:"fastdb_ip"`
	FastDBAddress     string
	FastDBName        string    `toml:"fastdb_dbname"`
	DBPort            uint16    `toml:"db_port"`
	DBIp              string    `toml:"db_host"`
	DBName            string    `toml:"db_name"`
	DBUName           string    `toml:"db_uname"`
	DBPwd             string    `toml:"db_pwd"`
	DBInsertTableName string    `toml:"db_insert_table_name"`
	Debug             bool      `toml:"debug"`
	CalcJobs          []CalcJob `toml:"calc_job"`
	Index             []Index   `toml:"index"`
	SqlEngine         *sqlx.DB
}

type CalcJob struct {
	TriggerTime string `toml:"trigger_time"`
	BeginTime   string `toml:"begin_time"`
	EndTime     string `toml:"end_time"`
}

var MyConfig *Config

var Tags []string

var ProcessToIndex *map[string][]Index